
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class PARTS_STOCKMap : EntityTypeConfiguration<PARTS_STOCK>
    {
        public PARTS_STOCKMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.OWNER)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.SUPPLIER_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.SPEC_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("PARTS_STOCK");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.OWNER).HasColumnName("OWNER");
            this.Property(t => t.PARTS_ID).HasColumnName("PARTS_ID");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.SUPPLIER_NAME).HasColumnName("SUPPLIER_NAME");
            this.Property(t => t.PARTS_SPEC_ID).HasColumnName("PARTS_SPEC_ID");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.PARTS_COUNT).HasColumnName("PARTS_COUNT");
            this.Property(t => t.RECORD_DATE).HasColumnName("RECORD_DATE");
            this.Property(t => t.status).HasColumnName("status");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.TransferID).HasColumnName("TransferID");
            this.Property(t => t.TransferID).HasColumnName("TransferID");
            this.Property(t => t.In_Stock_ID).HasColumnName("IN_STOCK_ID");
        }
    }
}
